<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<title>My JSP 'tsql.jsp' starting page</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">


</head>

<body>
	

	<sql:query var="result" sql="select * from t_employee" maxRows="2"
		startRow="1" />

	结果集的实质是：${result}
	<br> 得到的行数为：${result.rowCount}
	<br> 是否收到了maxRows的限制：${result.limitedByMaxRows}

	<hr>
	<table border="1" align="center">
		<tr>
			<c:forEach var="columnName" items="${result.columnNames}">
				<td><c:out value="${columnName}" /></td>
			</c:forEach>
		</tr>
		<c:forEach var="row" items="${result.rowsByIndex}">

			<tr>
				<c:forEach var="column" items="${row}">
					<td><c:out value="${column}" />
					</td>
				</c:forEach>

			</tr>

		</c:forEach>

	</table>

	This is my JSP page.
	<br>
</body>
</html>
